﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IOBusiness;
using System.Data;
using System.Text;

namespace Indochinaodyssey.UserControl.SliderImage
{
    public partial class BottomSlider : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    lblSlide.Text = SliderCruises();
                }
                catch 
                {
                }
            }
        }

        private string SliderCruises()
        {
            try
            {
                string sql = "Select ID,TieuDe,Url from tblHinhAnh where Loai=3";
                clsBSDungChung bs = new clsBSDungChung();
                DataTable tbCruises = new DataTable();
                tbCruises = bs.GetDataTableSQL(sql, "Cruises");
                StringBuilder menu = new StringBuilder();
                menu.Append("<ul id=\"mycarousel\" class=\"jcarousel-skin-tango\"> ");
                for (int i = 0; i < tbCruises.Rows.Count; i++)
                {
                    menu.Append("<li class=\"jcarousel-item\"><a href=\"http://www.halongsagatravel.com/\"><img src=\"Images/HinhAnh/" + tbCruises.Rows[i][2] + "\" alt=\"\" /></a></li>");
                }
                menu.Append("</ul> ");
                return menu.ToString();
            }
            catch 
            {
                throw;
            }
        }
    }
}